/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package officeboost.domain;

import javax.ejb.Stateless;
import javax.ejb.LocalBean;
import officeboost.mail.MailSenderInfo;
import officeboost.mail.SimpleMailSender;

/**
 *
 * @author 123
 */
@Stateless
@LocalBean
public class MailService {

    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")
    public void sentMail(String receive, String theme, String detail) {
        MailSenderInfo mailInfo = new MailSenderInfo();
        mailInfo.setMailServerHost("smtp.163.com");
        mailInfo.setMailServerPort("25");
        mailInfo.setValidate(true);
        mailInfo.setUserName("frank_king@163.com");
        mailInfo.setPassword("wangkaile");// 您的邮箱密码
        mailInfo.setFromAddress("frank_king@163.com");
        mailInfo.setToAddress(receive);
        mailInfo.setSubject(theme);
        mailInfo.setContent(detail);
        // 这个类主要来发送邮件
        SimpleMailSender sms = new SimpleMailSender();
        sms.sendTextMail(mailInfo);// 发送文体格式

    }
}
